home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 10
/
AACD 10.iso
/
AACD
/
Sound
/
MUImp3
/
MUICDID.mcd
< prev
next >
Wrap
Text File
|
2000-04-30
|
4KB
|
185 lines
/* */
address MUICDID
options results
parse arg name
option = word(name,1)
target = substr(name,length(option)+2)
prefs = 'envarc:MUImp3.prefs'
pref = 'envarc:MUICDID.prefs'
sorted = -3
sorten = -1
true = 1
false = 0
call open('work',prefs,'R')
do a = 1 to 13
line.a = readln('work')
end
call close('work')
if ~show('L',"rexxtricks.library") then call addlib('rexxtricks.library',0,-30,0)
if option="INIT" then do
call open('work',pref,'R')
aacdb=readln('work')
acddb=readln('work')
call close('work')
address MUICDID
popasl id acdb content aacdb
string id cddb content acddb
address command
'rx MUICDID.mcd GETID'
exit
end
if option="GETCDDB" then do
address MUICDID
popasl id acdb
aacdb=result
string id cddb
acddb=result
if aacdb="" then aacdb='ACDB'
if aacdb='RESULT' then aacdb='ACDB'
if acddb="" then acddb='sj.ca.us.cddb.com'
if acddb='RESULT' then acddb='sj.ca.us.cddb.com'
call open('work',pref,'W')
call writeln('work',aacdb)
call writeln('work',acddb)
call close('work')
popasl id acdb content aacdb
string id cddb content acddb
address command
cc=aacdb 'device='||line.1 'unit='||line.2 'host='||acddb 'disks='||line.13
'run >nil:' cc
'waitforport ACDB'
address ACDB
'CDID DOWNLOAD'
'QUIT'
address command
'rx MUICDID.mcd GETID'
exit
end
if option="SAVE" then do
address MUICDID
text id cdid
file=result
if file="" then exit
call open('work',makepath(line.13,file),'W')
string id title
call writeln('work',result)
string id arti
call writeln('work',result)
list id titel attrs 0x80421654
nr = result
list id titel
do a = 0 to nr-2
list id titel pos a
call writeln('work',result)
end
call close('work')
exit
end
if option="GETID" then do
file = "ID"
temp = maketemp('t:')
address command
'cdda mute list' line.3 '>'||temp
if rc>0 then exit
call open('work',temp,'R')
a = 0
do until eof('work')
a = a + 1
track.a = readln('work')
end
call close('work')
'delete >nil:' temp
nr = a - 3
file = file||overlay(nr,'00',3-length(nr))||'0'
if nr > 1 then do
file1 = d2x(value(word(track.2,6))+value(word(track.3,6)))
if word(track.2,2)>0 then file1 = d2x(value(word(track.2,6))+value(word(track.3,6)+value(word(track.2,2))))
if length(file1)<5 then file1=overlay(file1,'00000',6-length(file1))
end
else file1 = '00000'
file = file||file1||'0'
a = nr + 2
file1 = d2x(value(word(track.a,6)))
if word(track.2,2)>0 then file1 = d2x(value(word(track.2,2)+word(track.a,6)))
file = file||file1
address MUICDID
text id cdid label file
if exists(makepath(line.13,file)) then do
call open('work',makepath(line.13,file),'R')
a = 0
do until eof('work')
a = a + 1
targ.a = readln('work')
end
call close('work')
targ.0 = a - 1
address MUICDID
string id title content targ.1
string id arti content targ.2
address command
'rx MUICDID.mcd CLEAR'
address MUICDID
do a = 3 to targ.0
list id titel insert pos sorted string targ.a
end
list id titel insert pos sorted string "--End of Line--"
end
else do
call open('work',makepath(line.13,file),'W')
nr = value(substr(file,3,2))
call writeln('work','Unknown')
call writeln('work',file)
do a = 1 to nr
call writeln('work',file||'-'||overlay(a,00,3-length(a)))
end
call close('work')
address command
'rx MUICDID.mcd GETID'
end
exit
end
if option='REPLACE' then do
address MUICDID
list id titel
nr = result
list id titel remove string nr
list id titel insert pos sorten string target
list id titel
nr = result
list id titel
string id song content nr
string id song
exit
end
if option='CLEAR' then do
address MUICDID
list id titel string ""
exit
end
exit
maketemp:
parse arg path
a = 1
temp = makepath(path,'MUICDID.1.tmp')
do while exists(temp)
a = a + 1
temp = makepath(path,'MUICDID.'a'.tmp')
end
call open('work',temp,'W')
call close('work')
return temp